require(['jquery',rkjsPath+'rkTable.js',rkjsPath+'rkTags.js',rkjsPath+'rkWin.js',rkjsPath+'rkFormUtil.js',rkjsPath+'rkAlert.sweet.js',rkjsPath+'rkAjax.js',
	rkjsPath+'rkUtil.js'], function($,rkTable,rkTags,rkWin,rkFormUtil,rkAlert,rkAjax,rkUtil) {
	'use strict'
	var equipmentList=rkTable.init("equipmentList", "/rk/web/rrs/cost/equipment/queryPage",{},"radio","searchBtn");
	var btns=rkTags.btn.addEditDelBtn("tableDiv", true, function(){
		rkWin.win("/views/cms/cost/equipment/equipment.detail.html",{method:"add"},"新增设备",
		function(){
			rkTable.reload(equipmentList);
		});
	}, function(){
		var ids=rkTable.getChecked("equipmentList");
		if(rkUtil.rkStrUtil.isNull(ids)){
			rkAlert.errAlertMsg("请选择一条记录");
			return;
		}
		rkWin.win("/views/cms/cost/equipment/equipment.detail.html",{method:"edit",id:ids[0],ajaxUrl:"/rk/web/rrs/cost/equipment/query"},"编辑设备",
		function(){
			rkTable.reload(equipmentList);
		});
	}, function(){
		var ids=rkTable.getChecked("equipmentList");
		if(rkUtil.rkStrUtil.isNull(ids)){
			rkAlert.errAlertMsg("请至少选择一条记录");
			return;
		}
		rkAjax.postAjaxNoErr("/rk/admin/rrs/cost/equipment/delete",{idArr:ids},function(data){
			rkAlert.succAlert(data.msg);
		});
	});
});
function renderEquType(data, type, row, meta){
	return rkTableObj.tableRender.renderDic(data,row,meta,"equipmentType");
}
function renderPositionCode(data, type, row, meta){
	return rkTableObj.tableRender.renderDic(data,row,meta,"department");
}